import request from '@/utils/request'

// 新增网关
export function addGateways(data) {
    
    return request({
        url: '/equipment/add/gateway',
        method: 'POST',
        data
    })
}

// 编辑网关列表
export function editorGateway(data) {
    return request({
        url: '/equipment/update/gateway',
        method: 'POST',
        data
    })
}
// 解绑网关
export function unBound(params) {
    return request({
        url: '/equipment/gateway/unbound',
        method: 'PUT',
        params
    })
}

// 删除网关
export function delGateways(params) {
    return request({
        url: '/equipment/gateway',
        method: 'DELETE',
        params
    })
}

// 获取网关列表
export function getGatewayLists(id) {
    return request({
        url: `/equipment/station/gateway/${id}`,
        method: 'GET',
    })
}
// 删除网关下所有逆变器
export function delAllInveter(id) {
  return request({
      url: `/equipment/gateway/${id}`,
      method: 'DELETE',
  })
}
//网关配网
// stationBoard/distributionNetwork
export function distributionNetwork(params) {
    return request({
        url: '/stationBoard/distributionNetwork',
        method: 'GET',
        params
    })
}
// 添加逆变器
export function addPs(data) {
    return request({
        url: '/equipment/add/ps',
        method: 'POST',
        data
    })
}

// 获取网关下已绑定的逆变器
export function getDindingInverter(id) {
    return request({
        url: `/equipment/gateway/ps/${id}`,
        method: 'GET',
    })
}
// 获取电站下所有已绑定/未绑定 的逆变器
export function getDindingInverterS(params) {
    return request({
        url: '/equipment/station/ps',
        method: 'GET',
        params
    })
}
// 一键添加网关和逆变器
export function oneTapAddAllGateway(data) {
  return request({
      url: '/equipment/batchAdd/gatewayPs',
      method: 'POST',
      data
  })
}
//一键删除网关和逆变器
export function oneTapDelAllGateway(params) {
  return request({
      url: '/equipment/removeAll',
      method: 'GET',
      params
  })
}
// 逆变器解绑/删除
export function unboundDel(data) {
    return request({
        url: '/equipment/ps/unbound',
        method: 'PUT',
        data
    })
}


